package com.luhe.musicscore.painter.localfont;


import com.luhe.musicscore.painter.Painter;
import java.awt.*;
import java.io.FileInputStream;
import java.io.InputStream;

//使用字体实现的绘图功能
public class LocalFontPainter extends Painter {

    public static Font font1;
    public LocalFontPainter(){}
    static {
        try {
            InputStream inputStream = new FileInputStream("C:\\Users\\jme22\\IdeaProjects\\lumusic\\src\\com\\luhe\\staff\\akvo.ttf");
            font1 = Font.createFont(Font.PLAIN, inputStream);
            font1 = font1.deriveFont(java.awt.Font.PLAIN, 40);
            GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(font1);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
